﻿// JScript 文件

 function changecss(name,_skinId)
    {
       var date=new Date();
       date.setTime(date.getTime()+30*24*3066*1000);
       document.getElementsByTagName("link")[0].href = "/js/ext/resources/css/" + name;
       document.cookie = "css=" + name + ";expires=" + date.toGMTString() + ";"; //设置cookies
       document.cookie =  "skinId=" + _skinId + ";expires=" + date.toGMTString() + ";"; //设置cookies
    }
    var cookiesArr = document.cookie.split(";");
  var css = "";
  var tempSkinId = 0;
  for(var i=0;i<cookiesArr.length;i++)
  {
       var arr=cookiesArr[i].split("=");
       if(arr[0]=="css")
       {
          css=arr[1];

      } 
      if (arr[0].toString() == "skinId") {
          tempSkinId = arr[1];
      }
     
  }
  if (css == "") {
      css = "ext-all.css";
  }

  document.getElementsByTagName("link")[0].href = "/js/ext/resources/css/" + css;
   var skinID = tempSkinId;
            function setSkin(i)
            {
                var pattern = /[0-2]/;
                if(pattern.test(i))
                {
                   
                     if(i==0)
                    {
                        changecss('ext-all.css',i);
                    }
                     if(i==1)
                    {
                        changecss('ext-all-gray.css',i);

                    }
//                     if(i==2)
//                    {
//                       changecss('xtheme-gray.css');
//                    }
//                    if(i==3)
//                    {
//                        changecss('xtheme-purple.css');
//                    }
//                    if(i==4)
//                    {      
//                        changecss('xtheme-darkgray.css');
//                    } 
                     
                    
                }
            }
